/**
 * @UiApp.hpp
 * Copyright 2013 (C) FatalEror / Dean Bahari
 * 
 * UiPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * See LICENSE file in main folder for more information.
 */

#ifndef _UI_APP_HPP_
#define _UI_APP_HPP_

typedef HRESULT (WINAPI *lpfnDwmSetWindowAttribute)(HWND hWnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute);

class UiResource;

class UiApp {
	ULONG_PTR   mGdiToken;
	HDC         mDCBuffer;
	HBITMAP     mBMBuffer;
	HANDLE      mOldBitmap;
	UiResource *mResource;
public:
	UiApp();
	~UiApp();

	int run();
	void quit();

	HDC     getDCBuffer();
	HBITMAP getBitmapBuffer();
private:
	static UiApp *currentApp;
	static int    OSVersion;
public:
	static UiApp *getCurrentApp();
	static UiResource *getResource();
	static int getOSVersion();

	enum OSVersion {
		UI_OS_WIN2000 = 50,
		UI_OS_WINXP,
		UI_OS_WINVISTA,
		UI_OS_WIN7,
		UI_OS_WIN8,
		UI_OS_WINMAX
	};

	// Win7/Vista function
	static lpfnDwmSetWindowAttribute DwmSetWindowAttribute;
};

#endif//_UI_APP_HPP_